﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.InventoryUI {
    import flash.events.*;
    import Engine.Managers.*;
    import flash.display.*;
    import flash.utils.*;
    import Display.DialogUI.*;
    import Classes.util.*;

    public class RemoveItemDialog extends GenericDialog {

        protected var m_itemName:String;
        protected var m_numAssetLoads:int = 3;
        protected var m_imagesLoaded:int = 0;
        protected var m_genAssetObject:Object;
        protected var m_loader:Loader;

        public function RemoveItemDialog(_arg1:String, _arg2:Function=null, _arg3:Boolean=true, _arg4:Function=null){
            this.m_itemName = _arg1;
            var _local5:String = ZLoc.t("Items", (_arg1 + "_friendlyName"));
            var _local6:String = ZLoc.t("Dialogs", "RemoveItemTitle", {itemName:_local5});
            var _local7:String = ZLoc.t("Dialogs", "RemoveItemMessage", {
                numItem:1,
                itemName:_local5
            });
            super(_local7, "", GenericDialogView.TYPE_REMOVECANCEL, _arg2, _local6, "", _arg3, 0, "", _arg4);
        }
        override protected function loadAssets():void{
            Global.delayedAssets.get(DelayedAssetLoader.GENERIC_DIALOG_ASSETS, this.makeGenAssets);
            Global.delayedAssets.get(DelayedAssetLoader.INVENTORY_ASSETS, makeAssets);
            var _local1:String = Global.gameSettings.getImageByName(this.m_itemName, "icon");
            this.m_loader = LoadingManager.load(_local1, this.onAssetsLoaded, LoadingManager.PRIORITY_HIGH);
        }
        protected function makeGenAssets(_arg1:DisplayObject, _arg2:String):void{
            this.m_genAssetObject = _arg1;
            this.onAssetsLoaded();
        }
        override protected function onAssetsLoaded(_arg1:Event=null):void{
            this.m_imagesLoaded++;
            if (this.m_imagesLoaded < this.m_numAssetLoads){
                return;
            };
            super.onAssetsLoaded(_arg1);
        }
        override protected function createAssetDict():Dictionary{
            var _local1:Dictionary = new Dictionary();
            _local1["dialog_bg"] = (new this.m_genAssetObject.dialog_bg_noclose() as DisplayObject);
            m_assetBG = _local1["dialog_bg"];
            _local1["countBG"] = m_comObject.countBG;
            _local1["countMaxBG"] = m_comObject.countMaxBG;
            _local1["cell_bg"] = m_comObject.inventoryCard;
            _local1["btn_minus_up"] = m_comObject.btn_minus_up;
            _local1["btn_minus_over"] = m_comObject.btn_minus_over;
            _local1["btn_minus_down"] = m_comObject.btn_minus_down;
            _local1["btn_plus_up"] = m_comObject.btn_plus_up;
            _local1["btn_plus_over"] = m_comObject.btn_plus_over;
            _local1["btn_plus_down"] = m_comObject.btn_plus_down;
            _local1["itemIcon"] = this.m_loader.content;
            return (_local1);
        }
        override protected function createDialogView(_arg1:Dictionary):GenericDialogView{
            var _local2:GenericDialogView = new RemoveItemDialogView(_arg1, this.m_itemName, m_message, m_dialogTitle, m_callback, m_SkipCallback);
            return (_local2);
        }

    }
}//package Display.InventoryUI 
